<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员仪表板 - 加强附魔金苹果模组</title>
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="css/admin-style.css" rel="stylesheet">
</head>
<body>
    <div class="admin-layout">
        <!-- 侧边栏 -->
        <nav class="admin-sidebar">
            <div class="sidebar-header">
                <img src="images/logo-small.svg" alt="管理员面板" class="sidebar-logo">
                <h3>管理面板</h3>
            </div>
            
            <ul class="sidebar-menu">
                <li class="menu-item active">
                    <a href="admin-dashboard.html">
                        <i class="fas fa-chart-pie"></i>
                        <span>仪表板</span>
                    </a>
                </li>
                <li class="menu-item">
                    <a href="admin-feedback.html">
                        <i class="fas fa-comments"></i>
                        <span>反馈管理</span>
                        <span class="badge" id="feedbackCount">0</span>
                    </a>
                </li>
                <li class="menu-item">
                    <a href="admin-settings.html">
                        <i class="fas fa-cog"></i>
                        <span>系统设置</span>
                    </a>
                </li>
                <li class="menu-divider"></li>
                <li class="menu-item">
                    <a href="index.html">
                        <i class="fas fa-external-link-alt"></i>
                        <span>返回网站</span>
                    </a>
                </li>
                <li class="menu-item">
                    <a href="#" onclick="logout()">
                        <i class="fas fa-sign-out-alt"></i>
                        <span>退出登录</span>
                    </a>
                </li>
            </ul>
        </nav>

        <!-- 主内容区域 -->
        <main class="admin-main">
            <!-- 顶部导航 -->
            <header class="admin-header">
                <div class="header-left">
                    <button class="sidebar-toggle" onclick="toggleSidebar()">
                        <i class="fas fa-bars"></i>
                    </button>
                    <h1>仪表板概览</h1>
                </div>
                <div class="header-right">
                    <div class="header-notification">
                        <i class="fas fa-bell"></i>
                        <span class="notification-badge">3</span>
                    </div>
                    <div class="header-user">
                        <img src="images/admin-avatar.svg" alt="管理员" class="user-avatar">
                        <span>管理员</span>
                    </div>
                </div>
            </header>

            <!-- 仪表板内容 -->
            <div class="dashboard-content">
                <!-- 统计卡片 -->
                <div class="stats-grid">
                    <div class="stat-card primary">
                        <div class="stat-icon">
                            <i class="fas fa-download"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="totalDownloads">1,234</h3>
                            <p>总下载量</p>
                            <span class="stat-change positive">+12%</span>
                        </div>
                    </div>
                    
                    <div class="stat-card success">
                        <div class="stat-icon">
                            <i class="fas fa-users"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="activeUsers">856</h3>
                            <p>活跃用户</p>
                            <span class="stat-change positive">+8%</span>
                        </div>
                    </div>
                    
                    <div class="stat-card warning">
                        <div class="stat-icon">
                            <i class="fas fa-comments"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="pendingFeedbacks">23</h3>
                            <p>待处理反馈</p>
                            <span class="stat-change negative">+3</span>
                        </div>
                    </div>
                    
                    <div class="stat-card info">
                        <div class="stat-icon">
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="averageRating">4.8</h3>
                            <p>平均评分</p>
                            <span class="stat-change positive">+0.2</span>
                        </div>
                    </div>
                </div>

                <!-- 图表和数据 -->
                <div class="dashboard-grid">
                    <!-- 下载趋势图 -->
                    <div class="dashboard-card">
                        <div class="card-header">
                            <h3>下载趋势</h3>
                            <div class="card-actions">
                                <select id="downloadPeriod">
                                    <option value="7d">最近7天</option>
                                    <option value="30d">最近30天</option>
                                    <option value="90d">最近90天</option>
                                </select>
                            </div>
                        </div>
                        <div class="card-content">
                            <canvas id="downloadChart" width="400" height="200"></canvas>
                        </div>
                    </div>

                    <!-- 反馈分类 -->
                    <div class="dashboard-card">
                        <div class="card-header">
                            <h3>反馈分类统计</h3>
                        </div>
                        <div class="card-content">
                            <canvas id="feedbackChart" width="300" height="200"></canvas>
                        </div>
                    </div>

                    <!-- 最新反馈 -->
                    <div class="dashboard-card">
                        <div class="card-header">
                            <h3>最新反馈</h3>
                            <a href="admin-feedback.html" class="card-link">查看全部</a>
                        </div>
                        <div class="card-content">
                            <div id="recentFeedbacks" class="recent-list">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>

                    <!-- 系统状态 -->
                    <div class="dashboard-card">
                        <div class="card-header">
                            <h3>系统状态</h3>
                        </div>
                        <div class="card-content">
                            <div class="system-status">
                                <div class="status-item">
                                    <div class="status-indicator online"></div>
                                    <span>网站运行状态</span>
                                    <span class="status-value">正常</span>
                                </div>
                                <div class="status-item">
                                    <div class="status-indicator online"></div>
                                    <span>存储使用率</span>
                                    <span class="status-value">23%</span>
                                </div>
                                <div class="status-item">
                                    <div class="status-indicator warning"></div>
                                    <span>缓存状态</span>
                                    <span class="status-value">需清理</span>
                                </div>
                                <div class="status-item">
                                    <div class="status-indicator online"></div>
                                    <span>备份状态</span>
                                    <span class="status-value">已完成</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 快速操作 -->
                    <div class="dashboard-card">
                        <div class="card-header">
                            <h3>快速操作</h3>
                        </div>
                        <div class="card-content">
                            <div class="quick-actions">
                                <button class="action-btn primary" onclick="exportData()">
                                    <i class="fas fa-download"></i>
                                    导出数据
                                </button>
                                <button class="action-btn success" onclick="backupData()">
                                    <i class="fas fa-shield-alt"></i>
                                    备份数据
                                </button>
                                <button class="action-btn warning" onclick="clearCache()">
                                    <i class="fas fa-broom"></i>
                                    清理缓存
                                </button>
                                <button class="action-btn info" onclick="sendNotification()">
                                    <i class="fas fa-bullhorn"></i>
                                    发送通知
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- 最新动态 -->
                    <div class="dashboard-card full-width">
                        <div class="card-header">
                            <h3>系统活动日志</h3>
                            <div class="card-actions">
                                <button class="btn-small" onclick="refreshLogs()">
                                    <i class="fas fa-sync-alt"></i>
                                    刷新
                                </button>
                            </div>
                        </div>
                        <div class="card-content">
                            <div id="activityLogs" class="activity-logs">
                                <!-- 动态生成 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="js/admin-dashboard.js"></script>
</body>
</html>